<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
session_start();
//$UserID = $_SESSION['ID'];
//$UserName = $_SESSION['UserName'];
$UserID = '05177291244';
include_once('Mysql_connect.inc');//启动连接，连接名：$conn
//echo "Welcome to your Assoc, President.".$UserName;
echo '<table>';
echo '<tr>';
echo '<th>sa_id</th>';
echo '<th>member_name</th>';
echo '<th>name</th>';
echo '<th>groups</th>';
echo '<th>title</th>';
echo '<th>membership</th>';
echo '<th>description</th>';
echo '</tr>';
$result = mysqli_query($conn, "SELECT
member.sa_id,
member.member_id,
member.member_name,
membergroup.groups,
studentassociation.title,
studentassociation.membership,
studentassociation.description
FROM
member ,
studentassociation ,
membergroup
WHERE
studentassociation.president_id =  '$UserID' AND
studentassociation.sa_id =  member.sa_id AND
member.groups =  membergroup.id
");
while (($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) != NULL) {
    echo '<tr>';
    echo '<td>' . $row['sa_id'] . '</td>';
    echo '<td>' . $row['member_id'] . '</td>'; 
    echo '<td>' . $row['member_name'] . '</td>';
    echo '<td>' . $row['groups'] . '</td>';
    echo '<td>' . $row['title'] . '</td>';
    echo '<td>' . $row['membership'] . '</td>';
    echo '<td>' . $row['description'] . '</td>';
    echo '</tr>';
}

mysqli_free_result($result);
echo '</table>';
$Total = $conn->affected_rows;
echo "Total: ".$Total;


include_once('Mysql_unconnect.inc'); //断开连接

?>
